<template>
  <a-drawer
    :title="formInfo.id == undefined ? '新增' : '修改'"
    :maskClosable="true"
    width="1000"
    placement="right"
    :closable="true"
    @close="handleCancel"
    :destroyOnClose="true"
    :visible="visible"
    :footer="null"
  >
    <dev-contract-save
      ref="devContractSaveRef"
      @ok="devContractSaveOk"
      @close="handleCancel"
    ></dev-contract-save>
    <div style="margin-bottom: 20px"></div>
  </a-drawer>
</template>

<script>
import moment from 'moment'
import { getAction, postAction } from '@/api/manage'
import DevContractSave from './DevContractSave.vue'
export default {
  name: 'DevContractEdit',
  components: { DevContractSave },
  data() {
    return {
      formInfo: {},
      visible: false,
    }
  },
  computed: {},
  created() {},
  methods: {
    moment,
    addDrawer() {
      this.visible = true
      this.$nextTick(() => {
        this.$refs.devContractSaveRef.add()
      })
    },
    editDrawer(record) {
      this.formInfo = record
      this.visible = true
      this.$nextTick(() => {
        this.$refs.devContractSaveRef.edit(record)
      })
    },

    // 关闭
    handleCancel() {
      this.close()
    },
    close() {
      this.$emit('close')
      this.visible = false
    },
    devContractSaveOk(val) {
      this.handleCancel()
    },
  },
}
</script>
